<div class="catrucs view">
<h2><?php  __('Catruc');?></h2>
	<dl><?php $i = 0; $class = ' class="altrow"';?>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Id'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $catruc['Catruc']['id']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Macatruc'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $catruc['Catruc']['macatruc']; ?>
			&nbsp;
		</dd>
		<dt<?php if ($i % 2 == 0) echo $class;?>><?php __('Diengiai'); ?></dt>
		<dd<?php if ($i++ % 2 == 0) echo $class;?>>
			<?php echo $catruc['Catruc']['diengiai']; ?>
			&nbsp;
		</dd>
	</dl>
</div>
<div class="actions">
	<h3><?php __('Thực hiện'); ?></h3>
	<ul>
		<li><?php echo $this->Html->link(__('Sửa Ca trực', true), array('action' => 'edit', $catruc['Catruc']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('Xóa Ca trực', true), array('action' => 'delete', $catruc['Catruc']['id']), null, sprintf(__('Are you sure you want to delete # %s?', true), $catruc['Catruc']['id'])); ?> </li>
		<li><?php echo $this->Html->link(__('DS Ca trực', true), array('action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Ca trực mới', true), array('action' => 'add')); ?> </li>
		<li><?php echo $this->Html->link(__('DS Trực', true), array('controller' => 'trucs', 'action' => 'index')); ?> </li>
		<li><?php echo $this->Html->link(__('Trực mới', true), array('controller' => 'trucs', 'action' => 'add')); ?> </li>
	</ul>
</div>
<div class="related">
	<h3><?php __('Liên kết Trực');?></h3>
	<?php if (!empty($catruc['Truc'])):?>
	<table id='tables' cellpadding = "0" cellspacing = "0">
	<tr>
		<th><?php __('STT'); ?></th>
		<th><?php __('Mã số Ca trực'); ?></th>
		<th><?php __('Mã số Nhân viên'); ?></th>
		<th><?php __('Ngày trực'); ?></th>
		<th class="actions"><?php __('Thực hiện');?></th>
	</tr>
	<?php
		$i = 0;
		foreach ($catruc['Truc'] as $truc):
			$class = null;
			if ($i++ % 2 == 0) {
				$class = ' class="altrow"';
			}
		?>
		<tr<?php echo $class;?>>
			<td><?php echo $truc['id'];?></td>
			<td><?php echo $truc['catruc_id'];?></td>
			<td><?php echo $truc['nhanvien_id'];?></td>
			<td><?php echo $truc['ngaytruc'];?></td>
			<td class="actions">
				<?php echo $this->Html->link(__('Xem', true), array('controller' => 'trucs', 'action' => 'view', $truc['id'])); ?>
				<?php echo $this->Html->link(__('Sửa', true), array('controller' => 'trucs', 'action' => 'edit', $truc['id'])); ?>
				<?php echo $this->Html->link(__('Xóa', true), array('controller' => 'trucs', 'action' => 'delete', $truc['id']), null, sprintf(__('Bạn có muốn xóa # %s?', true), $truc['id'])); ?>
			</td>
		</tr>
	<?php endforeach; ?>
	</table>
<?php endif; ?>

	<div class="actions">
		<ul>
			<li><?php echo $this->Html->link(__('Trực mới', true), array('controller' => 'trucs', 'action' => 'add'));?> </li>
		</ul>
	</div>
</div>
